<?php
	session_start();

	include("connect.php");
	$result = pg_query($dbConn, "SELECT auth.user FROM autenticacion auth WHERE auth.user ='".$_REQUEST["user"]."' AND auth.password='".$_REQUEST["password"]."'");
	if ($row = pg_fetch_object($result)) {
		$_SESSION['usuario']=$row->user;

		$sesion = "valida";
		header("Location: panelAdmin.php?mensaje=Ingreso valido");
	} else {
		header("Location: admin.php?mensaje=Ingreso invalido");
	}
?>
